﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="~/Pages/Default.aspx.cs" Inherits="ViewLayer.Pages._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script type="text/javascript">
        function Confirma() {
            //debugger
            var r = confirm("Deseja realmente excluir?");
            if (r == true) {
                //debugger
                return true;
            }
            else {
                //debugger
                return false;
            }
        }
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Bem-vindo ao Project Controller
    </h2>
    <asp:Panel ID="pnlProjects" runat="server">
        <p>Crie um projeto, clicando <asp:HyperLink ID="hypLnkCreate" runat="server" NavigateUrl="~/Pages/Projetos/CadastroProjeto.aspx">aqui</asp:HyperLink>.</p>
        

        <asp:GridView ID="grdProjetos" runat="server" AutoGenerateColumns="False" OnPageIndexChanging="grdProjetos_PageIndexChanging" 
            OnRowCommand="grdProjetos_RowCommand" OnRowDataBound="grdProjetos_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="Nome Projeto">
                    <ItemTemplate>
                        <asp:Label ID="lblNome" runat="server" Text=""></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Data in&amp;iacute;cio">
                    <ItemTemplate>
                        <asp:Label ID="lblDataInicio" runat="server" Text=""></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Data t&amp;eacute;rmino">
                    <ItemTemplate>
                        <asp:Label ID="lblDataTermino" runat="server" Text=""></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Visualizar">
                    <ItemTemplate>
                        <asp:Button ID="btnVisualizar" runat="server" Text="Visualizar" CommandName="Visualizar" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Remover">
                    <ItemTemplate>
                        <asp:Button ID="btnRemover" runat="server" Text="Remover" CommandName="Remover" OnClientClick="return Confirma()"/>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br />
    </asp:Panel>
</asp:Content>